<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body onload="setInterval(getDateTime,1000);">
		<div id="enclock"></div>
		<div id="cnclock"></div>
	</body>
	<script>
		function getDateTime(){
			
		var date=new Date();
		var enclock= document.getElementById("enclock");//获取div
		enclock.innerHTML="<font color='red'>"+date+"</font>"
		
		
		var cnclock=document.getElementById("cnclock");
		var day=date.getDate();
		var year=date.getFullYear();
		var month=date.getMonth();
		var second=date.getSeconds();
		cnclock.innerText=year+"年"+month+"月"+day+"日"+second+"秒";
		}
	</script>
</html>
